<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.lmpop.trade.tb_returngoods.*" %>
<%@ page import="java.util.*" %>

<%@ page import="com.lmpop.trade.ti_attach.Ti_attachInfo" %>
<%@ page import="com.lmpop.frame.util.PageTools" %>
<%
	request.setCharacterEncoding("UTF-8");
	
	Tb_returngoodsInfo returngoods = new Tb_returngoodsInfo();
	Tb_returngoods tb_returngoods = new Tb_returngoods();
//out.print(_user_id);
	tb_returngoods.setUser_id(_user_id);

	String iStart = "0";
	int limit = 5;
	if(request.getParameter("iStart")!=null) iStart = request.getParameter("iStart");
	List list = returngoods.getListByPage(tb_returngoods,Integer.parseInt(iStart),limit);
	
	int counter = returngoods.getCountByObj(tb_returngoods);
	String pageString = new PageTools().getGoogleToolsBar(counter,"index.jsp?iStart=",Integer.parseInt(iStart),limit);
	
%>
<div class="f-right">

	<form action="index.jsp" name="homeForm" method="post">
    <table width="100%" border="0" cellspacing="0" cellpadding="0"  >
      <tr>
        <td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="table_main">
            <tr>
              <th width="5%" height="40" align="center"><img src="/program/member/index/images/icon1.gif"/></th>
              <th width="75%"><h3>退货申请</h3></th>
			  <th width="20%"></th>
            </tr>
          </table>
		  
		  <div class="ts">&nbsp;&nbsp;<img src="/program/member/index/images/ts.gif" align="absmiddle" />&nbsp;未处理申请可以补充修改退货原因. </div>
		 
          <table width="100%" height="30"  cellspacing="1" cellpadding="1"  class="table_ls">
            <tr height="28">
				<th width="40%" align="left" colspan="2">商品信息</th>  
				<th width="25%" align="left">所属订单</th>  
				<th width="20%" align="left">处理状态</th>  	
				<th width="20%" align="left">操作</th>
            </tr>
          </table>
          <% 
          		int listsize = 0;
				if(list!=null && list.size()>0){
					Hashtable map = new Hashtable();
					Hashtable goodsmap = new Hashtable();
					listsize = list.size();
					for(int i=0;i<list.size();i++){
					map = (Hashtable)list.get(i);
					String info_id="",order_no="",pub_state="",in_date="",cust_id="",goods_id="",file_path="",goods_name="";
					if(map.get("cust_id")!=null) cust_id = map.get("cust_id").toString();
					if(map.get("goods_id")!=null) goods_id = map.get("goods_id").toString();
					if(map.get("goods_name")!=null) goods_name = map.get("goods_name").toString();
					if(map.get("info_id")!=null) info_id = map.get("info_id").toString();
					if(map.get("order_no")!=null) order_no = map.get("order_no").toString();
					if(map.get("pub_state")!=null) pub_state = map.get("pub_state").toString();
					if(map.get("in_date")!=null) in_date = map.get("in_date").toString();
					if(map.get("file_path")!=null) file_path = map.get("file_path").toString();
					if(in_date.length()>19)in_date=in_date.substring(0,19);
					String state_name ="";
					if(pub_state.equals("0")){state_name="未处理";}else if(pub_state.equals("1")){state_name="正在处理";}else if(pub_state.equals("2")){state_name="处理结束";}
					if(file_path.equals("")){
						 file_path ="/program/member/images/cpwu.gif";            
					}
		  %>
          <table width="100%" style="border:1px solid #cecece; border-top:0" cellpadding="1" cellspacing="1" id="line<%=i%>">
			<tr height="80">
				<td width="2%" align="left" valign="middle">
					<img src="<%=file_path%>" width="60" height="60" border="0"/>
				</td>
				<td width="20%" align="left" valign="middle">
					<%=goods_name%>
				</td>
				<td width="15%" align="center">
				<a href="/program/member/order/detailindex.jsp?order_no=<%=order_no%>&menu_id=A627r83634Q86NP"><%=order_no%></a>
				</td>
				<td width="15%" align="center"><%=state_name%></td>
				<td width="10%" align="center">
					<a href="/program/member/order/returnIndex.jsp?order_no=<%=order_no%>&cust_id=<%=cust_id%>&goods_id=<%=goods_id%>">查看详细</a>
				</td>
            </tr>
          </table>
          <%
          		}
          	}
          %>
          
          <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td width="4%" height="35" align="center">
              	<%=pageString%>
              </td>
            </tr>
          </table>   
        </td>
      </tr>
    </table>
   </form>
  </div>